<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <title>管理员页面</title>
    <link rel="stylesheet" href="/static/css/admin.css"/>
    <link rel="stylesheet" href="/static/css/amazeui.min.css">
    <link rel="stylesheet" href="/static/css/app.css">
    {#    <link rel="stylesheet" href="/static/css/bootstrap.css">#}
    <script src="/static/js/jquery-3.3.1.js"></script>
    <script src="/static/js/bootstrap.min.js"></script>
</head>

<body data-type="generalComponents">
<!--------------------top1------------------>
<header class="am-topbar am-topbar-inverse admin-header">
    <div class="am-collapse am-topbar-collapse" id="topbar-collapse">
        <ul class="am-nav am-nav-pills am-topbar-nav am-topbar-right admin-header-list tpl-header-list">
            <!-------个人中心-------------------->
            {% if admin_name and admin_face %}
                <li class="am-dropdown" data-am-dropdown data-am-dropdown-toggle>
                    <a class="am-dropdown-toggle tpl-header-list-link" href="javascript:;">
                        <span class="tpl-header-list-user-nick">{{ admin_name }}</span><span
                            class="tpl-header-list-user-ico">
                      <img src="{{ admin_face }}">
                    </span>
                    </a>
                    <ul class="am-dropdown-content">
                        <li>
                            <a href="#"><span class="am-icon-bell-o"></span> 资料</a>
                        </li>
                        <li>
                            <a href="#"><span class="am-icon-cog"></span> 设置</a>
                        </li>
                        <li>
                            <a href="/admin/adminLogout"><span class="am-icon-power-off"></span> 退出</a>
                        </li>
                    </ul>
                </li>
            {% else %}
                <li class="am-dropdown">
                    <a href="/admin/adminLogin"><p style="color: #0a628f">登录</p></a>
                </li>
            {% endif %}

            <!-------个人中心------------------------------------------>

            <li style="margin-right: 40px;"></li>
        </ul>
    </div>
</header>

<!---------------header-------------------------->
<!---    左侧导航栏---------------->
<div class="tpl-page-container tpl-page-header-fixed">
    <div class="tpl-left-nav tpl-left-nav-hover">
        <div class="tpl-left-nav-list">
            <ul class="tpl-left-nav-menu">
                <li class="tpl-left-nav-item">
                    <a href="#" class="nav-link">
                        <i class="am-icon-home"></i>
                        <span>首页</span>
                    </a>
                </li>
                <li class="tpl-left-nav-item">
                    <a href="/admin/addFindGoodItem/" class="nav-link tpl-left-nav-link-list">
                        <i class="am-icon-bar-chart "></i>
                        <span>失物招领</span>
                    </a>
                </li>
                <li class="tpl-left-nav-item">
                    <a href="#" class="nav-link tpl-left-nav-link-list active">
                        <i class="am-icon-bar-chart"></i>
                        <span>校园新闻</span>
                        <span id="msgCount"></span>
                    </a>
                </li>
                <li class="tpl-left-nav-item">
                    <a href="/admin/manageUser" class="nav-link tpl-left-nav-link-list">
                        <i class="am-icon-wpforms"></i>
                        <span>查看所有用户</span>
                    </a>
                </li>
                <li class="tpl-left-nav-item">
                    <a href="/admin/adminLogin" class="nav-link tpl-left-nav-link-list">
                        <i class="am-icon-key"></i>
                        <span>登录</span>
                    </a>
                </li>

            </ul>
        </div>
    </div>
    <!---    左侧导航栏---------------->
    <div class="tpl-content-wrapper">
        <div class="tpl-portlet-components">
            <div class="portlet-title">
                <div class="caption font-green bold">
                    <span class="am-icon-code"></span> 校园新闻
                </div>
            </div>
            <div class="tpl-block">
                <div class="am-g">
                    <div class="am-u-sm-12">
                        <form class="am-form">
                            <table class="am-table am-table-striped am-table-hover table-main">
                                <thead>
                                <tr>
                                    <th class="table-title">标题</th>
                                    <th class="table-type">内容</th>
                                    <th class="table-type">图片</th>
                                    <th class="table-date am-hide-sm-only" style="margin-left: 100px;">发布日期</th>
                                    <th class="table-set" style="margin-left: 500px;">操作</th>
                                </tr>
                                </thead>
                                <tbody>

                                {% if items %}
                                    {% for item in items %}
                                        <tr>
                                            <td>
                                                <a href="#" style="margin-left: 5px">
                                                    {{ item.title }}
                                                </a>
                                            </td>
                                            <td>
                                                <a href="#" style="margin-left: 5px">
                                                    {{ item.content }}
                                                </a>
                                            </td>
                                            <td>
                                                <a href="{{ item.pic1 }}" target="_blank">
                                                    <img src="{{ item.pic1 }}" style="width:50px;height:50px">
                                                </a>
                                            </td>
                                            <td class="am-hide-sm-only">{{ item.time }}</td>  
                                            <td>
                                                <div class="am-btn-toolbar">
                                                    <div class="am-btn-group am-btn-group-xs" style="margin-top: 6px">
                                                        <a href="/school/deleteItem/{{ item.item_id }}">
                                                            <div class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only">
                                                                <span class="am-icon-pencil-square-o"></span>删除
                                                            </div>
                                                        </a>
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
                                    {% endfor %}
                                {% endif %}
                                </tbody>
                            </table>
                            <hr>
                            <a href="/school/addItem/{{ admin_name }}">
                                <div class="am-btn am-btn-default am-btn-xs am-text-secondary">
                                    <span class="am-icon-pencil-square-o"></span> 添加校园新闻
                                </div>
                            </a>

                        </form>
                    </div>

                </div>
            </div>
            <div class="tpl-alert"></div>
        </div>
    </div>
</div>

<script src="/static/js/jquery-3.3.1.js"></script>
<script src="/static/js/amazeui.min.js"></script>
<script src="/static/js/app.js"></script>
</body>

</html>